// swift-tools-version: 5.4
// The swift-tools-version declares the minimum version of Swift required to build this package.

import PackageDescription

let package = Package(
    name: "JRKit",
    platforms: [
        .iOS(.v12)
    ],
    products: [
        // Products define the executables and libraries a package produces, making them visible to other packages.
        .library(
            name: "JRKit",
            targets: ["JRKit"]
        ),
        // 侧滑
        .library(
            name: "JRFullscreenPopGesture",
            targets: ["JRFullscreenPopGesture"]
        ),
        // Zip 压缩库
        .library(
            name: "ZipArchiveKit",
            targets: ["ZipArchiveKit"]
        ),
        .library(name: "MaterialShowcaseKit", targets: ["MaterialShowcaseKit"])
    ],
    dependencies: [
        .package(url: "https://gitee.com/dingjiarui/RxSwift", .upToNextMajor(from: "6.6.0")),
        .package(url: "https://gitee.com/dingjiarui/SnapKit", .upToNextMajor(from: "5.7.1")),
    ],
    targets: [
        // Targets are the basic building blocks of a package, defining a module or a test suite.
        // Targets can depend on other targets in this package and products from dependencies.
        .target(
            name: "JRKit", 
            dependencies: [
                "RxSwift",
                .productItem(name: "RxCocoa", package: "RxSwift"),
                .productItem(name: "RxRelay", package: "RxSwift"),
                .productItem(name: "RxBlocking", package: "RxSwift"),
                "SnapKit",
                "JRFullscreenPopGesture",
            ]
        ),
        .target(
            name: "JRFullscreenPopGesture"
        ),
        .binaryTarget(name: "ZipArchiveKit", path: "./Frameworks/ZipArchiveKit.xcframework"),
        .binaryTarget(name: "MaterialShowcaseKit", path: "./Frameworks/MaterialShowcaseKit.xcframework"),
        .testTarget(
            name: "JRKitTests",
            dependencies: [
                "JRKit",
                "RxSwift",
                "ZipArchiveKit",
                "MaterialShowcaseKit",
            ]
        ),
    ]
)
